home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / d.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  9KB  |  296 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Martin Szulecki <compiz@sukimashita.com>
  5.  Copyright (C) 2006 Martin Szulecki <compiz@sukimashita.com>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <!--
  24.     D Language specification
  25.  
  26.     Reference:
  27.         http://www.digitalmars.com/d/lex.html
  28. -->
  29. <language id="d" _name="D" version="2.0" _section="Sources">
  30.   <metadata>
  31.     <property name="mimetypes">text/x-dsrc</property>
  32.     <property name="globs">*.d</property>
  33.     <property name="line-comment-start">//</property>
  34.     <property name="block-comment-start">/*</property>
  35.     <property name="block-comment-end">*/</property>
  36.   </metadata>
  37.  
  38.   <styles>
  39.     <style id="comment" _name="Comment" map-to="def:comment"/>
  40.     <style id="error" _name="Error" map-to="def:error"/>
  41.     <style id="string" _name="String" map-to="def:string"/>
  42.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  43.     <style id="type" _name="Data Type" map-to="def:type"/>
  44.     <style id="special-token" _name="Special Token" map-to="def:preprocessor"/>
  45.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  46.     <style id="boolean" _name="Boolean" map-to="def:boolean"/>
  47.     <style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
  48.     <style id="decimal" _name="Decimal number" map-to="def:decimal"/>
  49.     <style id="binary" _name="Binary number" map-to="def:base-n-integer"/>
  50.     <style id="octal" _name="Octal number" map-to="def:base-n-integer"/>
  51.     <style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/>
  52.   </styles>
  53.  
  54.   <definitions>
  55.  
  56.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  57.       <start>//</start>
  58.       <include>
  59.         <context ref="def:in-line-comment"/>
  60.       </include>
  61.     </context>
  62.  
  63.     <context id="block-comment" style-ref="comment">
  64.       <start>/\*</start>
  65.       <end>\*/</end>
  66.       <include>
  67.         <context ref="def:in-comment"/>
  68.       </include>
  69.     </context>
  70.  
  71.     <context id="close-comment-outside-comment" style-ref="error">
  72.       <match>\*/(?!\*)</match>
  73.     </context>
  74.  
  75.     <context id="nesting-comment" style-ref="comment">
  76.       <start>/\+</start>
  77.       <end>\+/</end>
  78.       <include>
  79.         <context ref="nesting-comment"/>
  80.         <context ref="def:in-comment"/>
  81.       </include>
  82.     </context>
  83.  
  84.     <context id="double-quoted-string" style-ref="string">
  85.       <start>"</start>
  86.       <end>"</end>
  87.       <include>
  88.         <context ref="def:escape"/>
  89.         <context ref="def:line-continue"/>
  90.       </include>
  91.     </context>
  92.  
  93.     <context id="single-quoted-string" style-ref="string" end-at-line-end="true">
  94.       <start>'</start>
  95.       <end>'</end>
  96.       <include>
  97.         <context ref="def:escape"/>
  98.         <context ref="def:line-continue"/>
  99.       </include>
  100.     </context>
  101.  
  102.     <context id="backtick-quoted-string" style-ref="string">
  103.       <start>`</start>
  104.       <end>`</end>
  105.       <include>
  106.         <context ref="def:escape"/>
  107.         <context ref="def:line-continue"/>
  108.       </include>
  109.     </context>
  110.  
  111.     <context id="keywords" style-ref="keyword">
  112.       <keyword>abstract</keyword>
  113.       <keyword>align</keyword>
  114.       <keyword>asm</keyword>
  115.       <keyword>assert</keyword>
  116.       <keyword>body</keyword>
  117.       <keyword>break</keyword>
  118.       <keyword>case</keyword>
  119.       <keyword>cast</keyword>
  120.       <keyword>catch</keyword>
  121.       <keyword>continue</keyword>
  122.       <keyword>debug</keyword>
  123.       <keyword>default</keyword>
  124.       <keyword>delegate</keyword>
  125.       <keyword>delete</keyword>
  126.       <keyword>deprecated</keyword>
  127.       <keyword>do</keyword>
  128.       <keyword>else</keyword>
  129.       <keyword>final</keyword>
  130.       <keyword>finally</keyword>
  131.       <keyword>for</keyword>
  132.       <keyword>foreach</keyword>
  133.       <keyword>function</keyword>
  134.       <keyword>goto</keyword>
  135.       <keyword>if</keyword>
  136.       <keyword>import</keyword>
  137.       <keyword>in</keyword>
  138.       <keyword>inout</keyword>
  139.       <keyword>is</keyword>
  140.       <keyword>mixin</keyword>
  141.       <keyword>new</keyword>
  142.       <keyword>out</keyword>
  143.       <keyword>override</keyword>
  144.       <keyword>pragma</keyword>
  145.       <keyword>private</keyword>
  146.       <keyword>protected</keyword>
  147.       <keyword>public</keyword>
  148.       <keyword>return</keyword>
  149.       <keyword>scope</keyword>
  150.       <keyword>super</keyword>
  151.       <keyword>switch</keyword>
  152.       <keyword>synchronized</keyword>
  153.       <keyword>this</keyword>
  154.       <keyword>throw</keyword>
  155.       <keyword>try</keyword>
  156.       <keyword>typeid</keyword>
  157.       <keyword>typeof</keyword>
  158.       <keyword>unittest</keyword>
  159.       <keyword>version</keyword>
  160.       <keyword>while</keyword>
  161.       <keyword>with</keyword>
  162.     </context>
  163.  
  164.     <context id="types" style-ref="type">
  165.       <keyword>alias</keyword>
  166.       <keyword>bool</keyword>
  167.       <keyword>byte</keyword>
  168.       <keyword>cdouble</keyword>
  169.       <keyword>cent</keyword>
  170.       <keyword>cfloat</keyword>
  171.       <keyword>char</keyword>
  172.       <keyword>class</keyword>
  173.       <keyword>creal</keyword>
  174.       <keyword>dchar</keyword>
  175.       <keyword>double</keyword>
  176.       <keyword>enum</keyword>
  177.       <keyword>export</keyword>
  178.       <keyword>float</keyword>
  179.       <keyword>idouble</keyword>
  180.       <keyword>ifloat</keyword>
  181.       <keyword>int</keyword>
  182.       <keyword>interface</keyword>
  183.       <keyword>invariant</keyword>
  184.       <keyword>ireal</keyword>
  185.       <keyword>long</keyword>
  186.       <keyword>module</keyword>
  187.       <keyword>package</keyword>
  188.       <keyword>real</keyword>
  189.       <keyword>short</keyword>
  190.       <keyword>struct</keyword>
  191.       <keyword>template</keyword>
  192.       <keyword>typedef</keyword>
  193.       <keyword>ubyte</keyword>
  194.       <keyword>ucent</keyword>
  195.       <keyword>uint</keyword>
  196.       <keyword>ulong</keyword>
  197.       <keyword>union</keyword>
  198.       <keyword>ushort</keyword>
  199.       <keyword>void</keyword>
  200.       <keyword>wchar</keyword>
  201.  
  202.       <!-- split these ones? -->
  203.       <keyword>auto</keyword>
  204.       <keyword>const</keyword>
  205.       <keyword>extern</keyword>
  206.       <keyword>static</keyword>
  207.       <keyword>volatile</keyword>
  208.     </context>
  209.  
  210.     <context id="special-tokens" style-ref="special-token">
  211.       <keyword>#line</keyword>
  212.       <keyword>__FILE__</keyword>
  213.       <keyword>__LINE__</keyword>
  214.       <keyword>__DATE__</keyword>
  215.       <keyword>__TIME__</keyword>
  216.       <keyword>__TIMESTAMP__</keyword>
  217.       <keyword>__VENDOR__</keyword>
  218.       <keyword>__VERSION__</keyword>
  219.     </context>
  220.  
  221.     <context id="null-value" style-ref="null-value">
  222.       <keyword>null</keyword>
  223.     </context>
  224.  
  225.     <context id="boolean" style-ref="boolean">
  226.       <keyword>false</keyword>
  227.       <keyword>true</keyword>
  228.     </context>
  229.  
  230.     <context id="float" style-ref="floating-point">
  231.       <match extended="true">
  232.         (?<![\w\.])
  233.         ([0-9_]+[Ee][-]?[0-9_]+|([0-9_]*\.[0-9_]+|[0-9_]+\.)([Ee][-]?[0-9_]+)?)[fFLi]?
  234.         (?![\w\.])
  235.       </match>
  236.     </context>
  237.  
  238.     <context id="decimal" style-ref="decimal">
  239.       <match extended="true">
  240.         (?<![\w\.])
  241.         ([1-9][0-9_]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?
  242.         (?![\w\.])
  243.       </match>
  244.     </context>
  245.  
  246.     <context id="binary" style-ref="binary">
  247.       <match extended="true">
  248.         (?<![\w\.])
  249.         0[bB][01_]*
  250.         (?![\w\.])
  251.       </match>
  252.     </context>
  253.  
  254.     <context id="octal" style-ref="octal">
  255.       <match extended="true">
  256.         (?<![\w\.])
  257.         0[0-7_]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?
  258.         (?![\w\.])
  259.       </match>
  260.     </context>
  261.  
  262.     <context id="hexadecimal" style-ref="hexadecimal">
  263.       <match extended="true">
  264.         (?<![\w\.])
  265.         0[xX][0-9a-fA-F_]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?
  266.         (?![\w\.])
  267.       </match>
  268.     </context>
  269.  
  270.     <context id="d">
  271.       <include>
  272.         <context ref="def:shebang"/>
  273.         <context ref="line-comment"/>
  274.         <context ref="block-comment"/>
  275.         <context ref="close-comment-outside-comment"/>
  276.         <context ref="nesting-comment"/>
  277.         <context ref="double-quoted-string"/>
  278.         <context ref="single-quoted-string"/>
  279.         <context ref="backtick-quoted-string"/>
  280.         <context ref="keywords"/>
  281.         <context ref="types"/>
  282.         <context ref="special-tokens"/>
  283.         <context ref="null-value"/>
  284.         <context ref="boolean"/>
  285.         <context ref="float"/>
  286.         <context ref="binary"/>
  287.         <context ref="octal"/>
  288.         <context ref="decimal"/>
  289.         <context ref="hexadecimal"/>
  290.       </include>
  291.     </context>
  292.  
  293.   </definitions>
  294.  
  295. </language>
  296.